package com.yamanyar.weebill.dao.impl.jpa;

import java.util.List;

import javax.persistence.Query;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.yamanyar.weebill.dao.ActionPathDAO;
import com.yamanyar.weebill.domain.ActionPath;
/**
 * JPA implementation of <code>AcionPathDAO</code>.
 * 
 * Created in Jun 29, 2008.
 * @author Kaan Yamanyar
 */
@Repository
public class ActionPathDAOImpl extends GenericDAOImpl<ActionPath, Long>
		implements ActionPathDAO {

	@SuppressWarnings("unchecked")
	@Transactional(readOnly = true)
	public List<ActionPath> findByName(String name) {
		Query query = entityManager
				.createQuery("Select a from ActionPath a where a.name = ?1");
		query.setParameter(1, name);

		return query.getResultList();
	}

}
